package com.mdb.open.trade.service.trade.handle;

import com.mdb.bc.api.data.ResultEx;
import com.mdb.open.trade.feign.dto.BaseHeadSimpleDto;
import com.mdb.open.trade.feign.dto.CommonRequestDto;
import com.mdb.open.trade.service.trade.handle.dto.LoanAccountDto;
import com.mdb.open.trade.service.trade.handle.dto.LoanCommitDto;
import com.mdb.open.trade.service.trade.handle.vo.LoanAccountInfoVo;
import com.mdb.open.trade.service.trade.handle.vo.LoanCommitVo;
import org.springframework.stereotype.Service;

/**
 * @description:
 * @author: you.yichao
 * @create: 2019-08-13 21:23
 **/
@Service
public class LoanHandle extends BaseHandle {

    public ResultEx<LoanCommitVo> loanCommit(LoanCommitDto dto, String refNo) {
        CommonRequestDto requestDto = new CommonRequestDto();
        BaseHeadSimpleDto simpleDto = new BaseHeadSimpleDto();
        simpleDto.setReqRef(refNo);

        requestDto.setHead(simpleDto);
        requestDto.setBody(dto);

        ResultEx<LoanCommitVo> resultEx = outReachWebFeignClient.requestCoreApi0351321(requestDto);

        return resultEx;
    }

    public ResultEx<LoanAccountInfoVo> loanAccountInfo(LoanAccountDto dto) {

        CommonRequestDto requestDto = new CommonRequestDto();

        requestDto.setBody(dto);

        ResultEx<LoanAccountInfoVo> resultEx = outReachWebFeignClient.requestCoreApi0131394(requestDto);
        return resultEx;

    }


}
